package com.hyh.shipment.controller;
import com.hyh.shipment.result.PageResult;
import com.hyh.shipment.service.ShipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/shipment")
public class ShipmentController {

    @Autowired
    private ShipmentService shipmentService;

    /*
     * @description: 发货
     * @param:
     * @return:
     * @author
     * @date: 2024/3/25 15:35
     */


    @PostMapping("/send/{orderNumber}")
    public PageResult shipment(@PathVariable("orderNumber") Integer orderNumber){
       return shipmentService.updateShipment(orderNumber);
    }


    /*
     * @description: 确认收货
     * @param:
     * @return:
     * @author
     * @date: 2024/3/25 15:43
     */
    @PostMapping("/confirmReceipt/{orderNumber}")
    public PageResult confirmReceipt(@PathVariable("orderNumber") Integer orderNumber){
        return shipmentService.confirmReceipt(orderNumber);
    }
}
